<template>
    <div>
        <el-card class="mt-4 !border-none" shadow="never" @tab-click="handleClick">
            <el-tabs v-model="activeName">
                <el-tab-pane label="基本信息" name="first">
                    <basic-data v-if="showEdit" ref="editRef"  @updateQueryParams="handleUpdateParams"/>
                </el-tab-pane>
                <el-tab-pane label="扩展信息" name="followUp">
                    <extend-data  ref="editRef" @updateExtend="handleUpdateExtend"  />
                </el-tab-pane>
                <el-tab-pane label="请款信息" name="second">
                    <withdraw-data />
                </el-tab-pane>
                <el-tab-pane label="回款信息" name="third">
                    <anwaer-data />
                </el-tab-pane>
                <el-tab-pane label="附件" name="attachment">
                    <annex-data />
                </el-tab-pane>
                <el-tab-pane label="案件信息" name="criminal ">
                    <case-data />
                </el-tab-pane>
                <el-tab-pane label="提醒" name="remind">
                    <RemindPopup />
                </el-tab-pane>
                <el-tab-pane label="发票列表" name="Invoice">
                    <invoice />
                </el-tab-pane>
                <el-tab-pane label="流程记录" name="flow">
                    <flowDataVue />
                </el-tab-pane>
            </el-tabs>
        </el-card>
<!--      <footer-btns>
        <div style="padding: 20px">
          <el-button v-perms="['basic:add']" type="primary" @click="handleSubmit">
            <template #icon>
              <icon name="el-icon-Plus" />
            </template>
            新增
          </el-button>
          <el-button
              v-perms="['customerlist:add/edit']"
              type="primary"
              @click="save()"
          >
            <template #icon>
              <icon name="el-icon-FolderChecked" />
            </template>
            保存
          </el-button>
          <el-button @click="resetParams">重置</el-button>
        </div>
      </footer-btns>-->
    </div>
</template>

<script lang="ts" setup>
import { nextTick,defineComponent, ref } from 'vue'
import basicData from './basicData.vue'
const editRef = shallowRef<InstanceType<typeof basicData>>()
import extendData from './extendData.vue'
import withdrawData from './withdrawData.vue'
import anwaerData from './anwaerData.vue'
import invoice from './invoice.vue'
import flowDataVue from './flowData.vue'
import caseData from './caseData.vue'
import RemindPopup from './remind/index.vue'
const remindEditRef = shallowRef<InstanceType<typeof RemindPopup>>()
import annexData from './clientFile/annexData.vue'
const fileEditRef = shallowRef<InstanceType<typeof annexData>>()

// const editRef = shallowRef<InstanceType<typeof basicData>>();
const showEdit = ref(true)
const addLinkshowEdit = ref(true)
const queryParamsFromChild = ref({});
const formData = ref({});

// 基础信息
/*const handleUpdateParams = (newParams: Record<string, any>) => {
  queryParamsFromChild.value = newParams;
};*/
//扩展信息
/*const handleUpdateExtend = (newParams: Record<string, any>) => {
  formData.value = newParams;
  console.log('接收子组件的更新数据:', newParams);
};*/
// 点击保存显示接收的数据
// const save= async ()=>{
//   console.log(queryParamsFromChild,formData)
// }

const handleClick = async (tab: any, event: any) => {
    if (tab == 'first') {
        showEdit.value = true
        await nextTick()
        editRef.value?.open()
    } else if (tab == 'second') {
        addLinkshowEdit.value = true
        await nextTick()
        // addLinkEditRef.value?.open();
    }
}
const activeName = 'first'
</script>

<style></style>
